/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */
package com.windea.study.kotlin.fxgl.sample.sandbox

import com.almasb.fxgl.app.*
import com.almasb.fxgl.dsl.*
import com.almasb.fxgl.texture.*
import javafx.scene.*
import javafx.scene.paint.*
import java.util.*

/**
 * http://blog.studiominiboss.com/pixelart #21
 * 1.
 * 2.
 * 3.
 *
 * @author Almas Baimagambetov (AlmasB) (almaslvl@gmail.com)
 */
class OutlineSample : GameApplication() {
	
	private val originals = ArrayList<Texture>()
	private val textures = ArrayList<Texture>()
	private val textures2 = ArrayList<Texture>()
	
	override fun initSettings(settings: GameSettings) {
		settings.width = 800
		settings.height = 600
		settings.title = "QuadSample"
		settings.version = "0.1"
	}
	
	override fun initGame() {
		//getGameScene().setBackgroundColor(Color.BLACK);
		
		val ship = texture("brick.png")
		
		val outlineSize = 1
		
		val ship1 = ship.copy()
		ship1.translateX = (-outlineSize).toDouble()
		
		val ship2 = ship.copy()
		ship2.translateX = outlineSize.toDouble()
		
		val ship3 = ship.copy()
		ship3.translateY = (-outlineSize).toDouble()
		
		val ship4 = ship.copy()
		ship4.translateY = outlineSize.toDouble()
		
		val group = Group(ship1.toColor(Color.BLACK), ship2.toColor(Color.BLACK), ship3.toColor(Color.BLACK), ship4.toColor(Color.BLACK), ship.copy())
		
		
		addUINode(ship, 100.0, 100.0)
		addUINode(group, 300.0, 100.0)
	}
}


fun main(args: Array<String>) {
	GameApplication.launch(OutlineSample::class.java, args)
}
